package com.danielagarza.app.servicios;

import android.app.Activity;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.widget.Toast;

public class Posicion implements LocationListener {

	private Activity activity;

	public Posicion(Activity activity) {
		this.activity = activity;
	}

	@Override
	public void onProviderDisabled(String provider) {
		Toast.makeText(activity.getApplicationContext(), "Gps Desactivado",
				Toast.LENGTH_SHORT).show();
	}

	@Override
	public void onProviderEnabled(String provider) {
		System.out.println("Gps Activo");
	}

	@Override
	public void onLocationChanged(Location loc) {
		loc.getLatitude();
		loc.getLongitude();
		String coordenadas = "Mis coordenadas son: " + "Latitud = "
				+ loc.getLatitude() + "Longitud = " + loc.getLongitude();
		System.out.println(coordenadas);

	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// TODO Auto-generated method stub

	}
}
